package com.woorigil.social.parser;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

public class LocalCategoryUtils {
	public static Map<String, Integer> foodLocals = new HashMap<String, Integer>() {{
		put("전국", 14);
		put("서울", 15);
		put("경기", 16);
		put("인천", 17);
		put("부천", 17);
		put("대전", 18);
		put("충청", 19);
		put("충남", 19);
		put("충북", 19);
		put("대구", 20);
		put("부산", 21);
		put("경상", 22);
		put("경남", 22);
		put("경북", 22);
		put("전라", 23);
		put("전남", 23);
		put("전북", 23);
		put("광주", 24);
		put("강원", 25);
		put("제주", 26);
	}};

	public static Map<String, Integer> butiLocals = new HashMap<String, Integer>() {{
		put("전국", 41);
		put("서울", 42);
		put("경기", 43);
		put("인천", 44);
		put("부천", 44);
		put("대전", 45);
		put("충청", 46);
		put("충남", 46);
		put("충북", 46);
		put("대구", 47);
		put("부산", 48);
		put("경상", 49);
		put("경남", 49);
		put("경북", 49);
		put("전라", 50);
		put("전남", 50);
		put("전북", 50);
		put("광주", 51);
		put("강원", 52);
		put("제주", 53);
	}};
	
	public static int getFoodCategoryId(String shopAddress) {
		for (Entry<String, Integer> entry : foodLocals.entrySet()) {
			if (shopAddress != null && shopAddress.contains(entry.getKey())) {
				return entry.getValue();
			}
		}
		return 100;
	}
	
	public static int getButiCategoryId(String shopAddress) {
		for (Entry<String, Integer> entry : butiLocals.entrySet()) {
			if (shopAddress != null && shopAddress.contains(entry.getKey())) {
				return entry.getValue();
			}
		}
		return 100;
	}
}
